import { post } from '@/request/http'
import store from '@/store'

// 获取 账单列表  查询数据
export const getBillListService = (data) =>
  post(
    '/FTKJWLHYPT/SysResultsFees/getPostingManageLists',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            chbFltId: store.state.user.FLT_UUID_DX_H,
            chbBillNo: data.billNum,
            chbPaycstId: data.payPeople,
          }
        }
      }
    }
  )

// 获取 客户列表 查询数据
export const getAccountListService = (data) =>
  post(
    '/FTKJWLHYPT/SysResultsFees/getAccountManagerList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            // cltDepId: store.state.user.DPTID_DX_H,
            cltId: data
          }
        }
      }
    }
  )

// 获取 供应商 查询数据
export const getCustomerService = (data) =>
  post(
    '/FTKJWLHYPT/SysResultsFees/getYFAccounManagerList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            fltId: data,
          }
        }
      }
    }
  )

// 获取 订单列表  查询数据
export const getOrderListService = (data) =>
  post(
    '/FTKJWLHYPT/SysResultsFees/getTmAttorenyListBill',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            ordEtpId: store.state.user.FLT_UUID_DX_H,
            cbmChbId: data.cbmChbId,
          }
        }
      }
    }
  )

// 获取 支付人  下拉框数据
export const payPeopleService = () =>
  post(
    '/FTKJWLHYPT/SysResultsFees/gGetPostingManageChbPayer',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            chbFltId: store.state.user.FLT_UUID_DX_H,
          }
        }
      }
    }
  )

// 获取 客户  下拉框数据
export const clientService = () =>
  post(
    '/FTKJWLHYPT/SysResultsFees/getOrderClient',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
          }
        }
      }
    }
  )

//  开账管理  保存  按钮
export const openBillSaveService = (data) =>
  post(
    '/FTKJWLHYPT/SysResultsFees/setPosting',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            chbFltId: store.state.user.FLT_UUID_DX_H,
            // chbBillNo: data.chbBillNo, // 账单号
            chbSettlemode: data.chbSettlemode, // 结算方式
            chbCheckno: data.chbCheckno, // 支票号
            chbJchbPaycstId: data.chbJchbPaycstId, // 户名  应付
            chbAddress: data.chbAddress, // 地址
            chbBpsign: data.chbBpsign, // 收支标志
            chbRemark: data.chbRemark, // 备注
            chbTax: data.chbTax, // 税号
            ordId: data.ordId, // 订单ID
            chbPaycstId: data.chbPaycstId, // 支付人ID 应收
            chbPayer: data.chbPayer, // 支付人
            chbLstupduser: store.state.user.USR_CODE_DX_H
          }
        }
      }
    }
  )

//  开账管理  弹窗  点击客户列表  展示下方
export const getBotDataService = (data) =>
  post(
    '/FTKJWLHYPT/SysResultsFees/getGetTmAttorenyOrdrList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            msiBpsign: data.msiBpsign,
            ordCltId: data.ordCltId,
            mslJchbPaycstid: data.mslJchbPaycstid,
          }
        }
      }
    }
  )

//  开账管理  弹窗  点击订单列表  展示右侧  开账费用列表
export const getOpenFeeListService = (data) =>
  post(
    '/FTKJWLHYPT/SysResultsFees/getNewMarshlingItemsList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            ordId: data.ordId, // 订单ID
          }
        }
      }
    }
  )

//  开账管理  弹窗  点击订单列表  展示右侧  开账费用列表
export const delOpenBillService = (data) =>
  post(
    '/FTKJWLHYPT/SysResultsFees/deleteTmsChargeBills',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            chbId: data.chbId, // 订单ID
          }
        }
      }
    }
  )

//  开账管理  弹窗  点击订单列表  展示右侧  开账费用列表
export const getBandService = (data) =>
  post(
    '/FTKJWLHYPT/base/getAuditUserToList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            cltId: data.cltId,
          }
        }
      }
    }
  )
